package com.ibs.hadoop.hbase.service.complaint.impl;

import java.util.List;

import com.ibs.hadoop.hbase.bean.QueryBean;
import com.ibs.hadoop.hbase.bean.RcvMmsBean;
import com.ibs.hadoop.hbase.bean.UseComplaintBaseClass;
import com.ibs.hadoop.hbase.dao.impl.RcvmmsDaoImpl;
import com.ibs.hadoop.hbase.service.complaint.UserComplaintDataQuery;

/**
 * 用户投诉查询
* 源文件名：UserComplaintAttachQuery.java
* 文件版本：1.0.0
* 创建作者：Think
* 创建日期：2016年10月31日
* 修改作者：Think
* 修改日期：2016年10月31日
* 文件描述：TODO
* 版权所有：Copyright 2016 zjhz, Inc. All Rights Reserved.
*/
public class UserComplaintRcvmmsQuery implements UserComplaintDataQuery {

    /**
     * 获得实例对象
    * @字段说明 INSTANCE
    */
    private static final UserComplaintRcvmmsQuery INSTANCE = new UserComplaintRcvmmsQuery();

    public static UserComplaintDataQuery getInstance() {
        return INSTANCE;
    }

    @Override
    public List<UseComplaintBaseClass> query(QueryBean query) {
        return RcvmmsDaoImpl.getInstance().query(query);
    }

    @Override
    public String parseLine(UseComplaintBaseClass userComplaint) {
        RcvMmsBean param = (RcvMmsBean) userComplaint;

        StringBuilder result = new StringBuilder();
        result.append("Frame").append(":").append(param.getFrame()).append(",");
        result.append("LastFrame").append(":").append(param.getLastFrame()).append(",");
        result.append("Ttime").append(":").append(param.getTtime()).append(",");
        result.append("RecordFileIndex").append(":").append(param.getRecordFileIndex()).append(",");
        result.append("Ci").append(":").append(param.getCi()).append(",");
        result.append("Apn").append(":").append(param.getApn()).append(",");
        result.append("Imsi").append(":").append(param.getImsi()).append(",");
        result.append("MobileType").append(":").append(param.getMobileType()).append(",");
        result.append("FailureCause").append(":").append(param.getFailureCause()).append(",");
        result.append("Success").append(":").append(param.getSuccess()).append(",");
        result.append("Timeout").append(":").append(param.getTimeout()).append(",");
        result.append("FromNumber").append(":").append(param.getFromNumber()).append(",");
        result.append("ToNumber").append(":").append(param.getToNumber()).append(",");
        result.append("LastFileindex").append(":").append(param.getLastFileindex()).append(",");
        result.append("Subject").append(":").append(param.getSubject()).append(",");
        result.append("ContentLength").append(":").append(param.getContentLength()).append(",");
        result.append("UriMain").append(":").append(param.getUriMain()).append(",");
        result.append("StartTime").append(":").append(param.getStartTime()).append(",");
        result.append("EndTime").append(":").append(param.getEndTime()).append(",");
        result.append("MmsVolume").append(":").append(param.getMmsVolume()).append(",");
        result.append("LastPacketsDelay").append(":").append(param.getLastPacketsDelay()).append(",");
        result.append("UlTeid").append(":").append(param.getUlTeid()).append(",");
        result.append("DlTeid").append(":").append(param.getDlTeid()).append(",");
        result.append("SGwIp").append(":").append(param.getSGwIp()).append(",");
        result.append("EnbIp").append(":").append(param.getEnbIp()).append(",");
        result.append("DestIp").append(":").append(param.getDestIp()).append(",");
        result.append("DestPort").append(":").append(param.getDestPort()).append(",");
        result.append("RatType").append(":").append(param.getRatType()).append(",");
        result.append("Uri").append(":").append(param.getUri()).append(",");
        result.append("RetransferCount").append(":").append(param.getRetransferCount()).append(",");
        result.append("Packets").append(":").append(param.getPackets()).append(",");
        result.append("UserIpValue").append(":").append(param.getUserIpValue()).append(",");
        result.append("Enb").append(":").append(param.getEnb()).append(",");
        result.append("SGw").append(":").append(param.getSGw()).append(",");
        result.append("TimeGap").append(":").append(param.getTimeGap()).append(",");
        result.append("Lasttime").append(":").append(param.getLasttime()).append(",");
        result.append("ZoneId").append(":").append(param.getZoneId()).append(",");
        return result.toString();
    }

}
